The Meridian 59 Server Administration

Author: Brian Green                                                     Last updated: Sept. 23, 2004

This document is intended to describe the important administrative commands and features of the Blakserv (Meridian 59) server.

Shutting down Meridian 59

The fastest way to shut down Meridian 59 is to:
This will save the game then immediately shut down the server.  It is advisable to give the players some time (usually 30 minutes) to put things in order before shutting down the server.  All game state is saved, including quests that could expire while the player is offline.  In most cases, players should NOT be affected by logoff ghost penalties if you shut down the game like this.

The Maintenance Port

What is it?

The maintenance port is a special port you can connect to and send administrative commands to. This is very useful for integrating a billing system with the server.

How do you use it?

Using the maintenance port requires 2 steps to establish the security of the connection. Both steps involve editing the blakserv.cfg on the server.

If you edit the blakserv.cfg file, you will notice that under the [Socket] header, you have 2 important keys:

[Socket]            
MaintenancePort      5959
MaintenanceMask      65.194.80.144;65.194.80.145

The "MaintenancePort" is the port the maintenance system listens to. By default, this is 9998. In our example, we're using 5959.

The "MaintenanceMask" are the IP numbers from which we can take messages. This is to provide a layer of security since the maintenance port does not require a login. Note that different IP numbers can be listed if separated with a semicolon (;). Up to 15 IP numbers can be specified this way.

Note that changing either of these values requires a restart of the server.

Once this has been done, you can simply open a connection to the server on this port from one of the trusted IP numbers specified. You send administrative commands in plain text; note that you could open a telnet connection to the server and send commands that way if desired (for testing, for example). A full list of administrative commands appears later in this document. Note that not all administrative commands are available via the administrative port, again for security reasons.

Special notes

There are two special error messages return via the mainteance port. The first is "Help is unavailable through maintenance mode."  This message can appear if you try to use the help command, or if you send only part of a proper command. The second message is "You do not have access to this command."  This is sent if you try to use a command that cannot be used via the maintenance port.

Administrator Commands

These are the basic commands that can be used to administrate the servers. These commands can be entered in the "Administration" pane of the server, via admin window control in the game, or by mainteance port (if allowed).  Sample output is shown so you can see normal messages and parse them for expected information.

If you are entering the commands via the server console or an admin window: you can type "help" for information about the commands. Typing part of a command will result in getting additional help about that command, including parameter information.

Command: create automated <account name> <password>
Parameters:
<account name> is a string that should be used for the account name. NOTE: This should not contain just numbers.
<password> is the initial password to be assigned to the account.
Purpose: Creates a user account with 1 user object associated with it.
Available by Maintenance Port? Yes
Sample output:
create automated test.account 1234
Created account 23.
 
23    7354 User    User2355399544
Comments: This should be the the default function used to create accounts to save on communication. It is recommended that you allow each account to have 2 character objects, so use the "create character" command found below. The second line of output shows the account number, the user object number (which can change), the type of character created (User), and the default name assigned to the character by the system.

Command: create account <type> <account name> <password>
Parameters:
<type> indicates the type of account: user, DM, or Admin.
<account name> is a string that should be used for the account name. NOTE: This should not contain just numbers.
<password> is the initial password to be assigned to the account.
Purpose: Creates an account with no character objects associated with it.
Available by Maintenance Port? NO.
Sample output:
create account admin test.admin 4321
Created ACCOUNT 24.
Comments: This is the way to create accounts above the user level. Note that the account determines the greatest amount of control allowed to a character. Therefore, a User account with a DM character will restrict the DM to user-level access; the DM will be unable to use any special client commands (those that start with "dm"), for example. Likewise, a User object on a DM-level account will look and behave just like a normal User character.

Command: create <character type> <account number>
Parameters:
<character type> indicates the type of character: user, DM, or Admin.
<account number> is the number of the account you wish to add the character to.
Purpose: Creates a character object and associates it with the specified account.
Available by Maintenance Port? Yes, but only for Users. You cannot create DMs or Admins via the maintenance port.
Sample output:
create user 24
Acct Object  Class   Name
  24    7368 User    User2456202510
Comments: This is the way to create additional user character objects. Note that the account determines the greatest amount of control allowed to a character. Therefore, a User account with a DM character will restrict the DM to User-level access; the DM will be unable to use any special client commands (those that start with "dm"), for example. Likewise, a User object on a DM-level account will look and behave just like a normal User character. The second line of output shows the account number, the user object number (which can change), the type of character created (User), and the default name assigned to the character by the system.

Command: delete account <account number>
Parameters:
<account number> is the number of the account you wish to delete.
Purpose: Deletes an account from the server.
Available by Maintenance Port? Yes.
Sample output:
delete account 24
Account 24 will be deleted.
Comments: This is how you permanently delete an account from the server. NOTE: Once deleted, an account cannot be restored automatically. Make sure you really want to delete an account before you do so. It is recommended that you suspend accounts that are no longer used for a long time (99999 hours is a good value). A suspension allows a user to come back to the game easier in the future. Meridian 59 currently does not recycle account numbers, so that numbers associated with deleted accounts will not be reused.

Command: suspend account <duration> <account number>
Parameters:
<duration> is the number of hours to suspend an account.
<account number> is the number of the account you wish to suspend.
Purpose: Temporarily suspends an account for a number of hours.
Available by Maintenance Port? Yes.
Sample output:
suspend account 99999 23
Account 23 (test.account) is suspended until Jul  9 2014 17:46:42.
Comments: This is the recommended way to disable an account of a customer cancelling the account. A duration of 99,999 hours is over 10 years, which should suffice. Shorter durations can be used as punishment for repeat offenders or at the request of a user that needs to focus on offline activities for a few days. A user that is suspended will be immediately logged off, so you do not need to send additional commands to disconnect them. Note that the duration of the suspension duration comes first, be careful not to suspend the wrong account!  Also note that time added is cumulative, so that a suspension of 24 hours plus 48 hours is a total suspension of 72 hours.  Accounts cannot be suspended beyond January 18, 2038 (the timestamp could cause an integer overflow error).  The server catches small additions beyond this date, but very large numbers (such as 999,999, for example) can cause previously suspended accounts to become unsuspended.

Command: unsuspend account <account number>
Parameters:
<account number> is the number of the account you wish to unsuspend.
Purpose: Unsuspends an account.
Available by Maintenance Port? Yes.
Sample output:
unsuspend account 23
Account 23 (test.account) is unsuspended.
Comments: This will eliminate all the suspension time that was remaining.

Command: set account object <account number> <character object number>
Parameters:
<account number> is the number of the account you wish to own the new character object.
<character object number> object number of the character you wish to move to the new account..
Purpose: Moves a character object from one account to another.
Available by Maintenance Port? Yes.
Sample output:
set account object 23 7299
Removing user object 7299 from the old account 23.
Associated account 23 with object 7299 as a user.
Comments: This command is not recommended to be used with the maintenance port, since character object numbers can and often do change during system saves.

Command: show account <account number>
Parameters:
<account number> is the number of the account you wish to examine.
(It is also possible to use the account name instead of the number, resulting in the same output.)
Purpose: Prints information about an account.
Available by Maintenance Port? Yes.
Sample output:
show account 23
Acct  Name                   Suspended Credits Last login
  23  test.account                        0.00 Never
Acct Object  Class   Name
  23    7354 User    User2355399544
  23    7355 User    User2357418822

show account 3
Acct  Name                   Suspended Credits Last login
   3A green.b                 99999.0h  250.81 Feb  9 2003 20:55:42
Acct Object  Class   Name
   3    4106 admin   Psychochild

show account 777
Cannot find account 777
Comments: There are 3 outputs shown above. The first one shows an account with two characters, but has never been logged on. The second one shows an admin account with only 1 character that is also suspended for 99999 hours. Note that the "Suspended" location is blank on the normal account. Also note that an admin account as an "A" after the account number in the first line. DM accounts will likewise have a "D" in that location. The "Credits" column is a historical relic from the original concept behind the game. This does show the cumulative time the account has been logged on. Each hundredth of a credit is one second, so the admin above has been logged on 25081 seconds total, which is just shy of 7 hours.

Command: show user <user name>
Parameters:
<user name> is the name of the character object you wish to examine.
(It is also possible to use the character's object number instead of the name, resulting in the same output.)
Purpose: Prints information about a character object.
Available by Maintenance Port?
Yes.
Sample output:
show user psychochild
Acct Object  Class   Name
   3    4106 admin   Psychochild

show user Bob

Cannot find user Bob.
Comments: Useful for finding the account number to suspend to punish a transgressor.  Note that character object numbers can and do change during system saves.  Object numbers are dynamic, but character names are generally not.

Command: set account password <account number> <password>
Parameters:
<account number> is the number of the account you wish to set the password on.
(It is also possible to use the account name instead of the number, resulting in the same output.)
<password> is the new password to be assigned to the account.
Purpose: Resets the password for a specific account.
Available by Maintenance Port? Yes.
Sample output:
set account password 23 dontforget
Set password for account 23 (test.account).
Comments: Used to reset a password, useful for people that forget their password.

Command: send users <message>
Parameters:
<message> is the message to be sent. It is recommended that you use "~B" in front of your messages to make them bold and stand out. 
Purpose:
Sends a messages to all users logged on.
Available by Maintenance Port? Yes.
Sample output:
send users ~BServer down in 10 minutes.
Sent to gamers: '~BServer down in 10 minutes.'.
Comments: You can send messages to the users, indicating things like planned downtime, etc. Note that the formatting characters used for in-game communication (such as ~B for bold) can be used in this string. The default color is yellow (or purple for the old client), since this is a system message.

Command: save game
Parameters:None
Purpose: Saves the game to the hard drive.
Available by Maintenance Port? Yes.
Sample output:
save game
Garbage collecting and saving game... done.  Save time is (1044958603).
Comments: Note that in the message above, the underlined part is not sent until the server is done saving. This could take several minutes on older and established servers.

Command: lock <reason>
Parameters:
<reason> is the text message given to players that try to log on.
Purpose: Locks the game so that no User can log on.
Available by Maintenance Port? NO.
Sample output:
lock Temporary maintenance.
Locking game <Temporary maintenance.>.
Comments: Useful to keep users offline while you update the game. Admins are still allowed to log on a locked game. This does not kick users off that are currently logged on. The server console shows a message near the top if the game is locked.

Command: unlock
Parameters:None
Purpose: Unlocks the game so that users can log on.
Available by Maintenance Port? NO.
Sample output:
unlock
Unlocking game.
Comments: Allows users back on.

Command: kickoff [all|account <account number>]
Parameters:
The "all" option requires no parameters, and affects all users.
The "account" option requires an account number, and only affects that account.
(It is also possible to use the account name instead of the number, resulting in the same effect.)
Purpose: Kicks selected user(s) out of the game. They can log back on immediately.
Available by Maintenance Port? NO.
Sample output:
kickoff all
Comments: This is a temporary kick off. Useful to kick all users off after locking the game for maintenance. It is also useful for kicking off people that are using macro or botting programs.

Command: hangup [all|account <account number>|IP <ip number>]
Parameters:
The "all" option requires no parameters, and affects all users.
The "account" option requires an account number, and only affects that account.
(It is also possible to use the account name instead of the number, resulting in the same effect.)
The "IP" option requires an IP number, which can use * as a wildcard.
Purpose: Kicks selected user(s) out of the game for about 10 minutes.
Available by Maintenance Port? Yes.
Sample output:
hangup all

hangup account 3
ACCOUNT 3 (green.b) SESSION 1 has been disconnected.

hangup account 23
ACCOUNT 23 (test.account) is not logged in.
Comments: This is a longer way to kick users off. Useful to give a troublemaker 10 minutes to cool down before being forced to use more drastic punishment.

Command: who
Parameters:None
Purpose: Shows a list of all users online.
Available by Maintenance Port? NO.
Sample output:
who

Name                Act Ver Sess Port               Where
----------------------------------------------------------------------------
green.b               3 557    1 neardeath          Game - Psychochild (4106)
Comments: A way to see all the users online at the current time. Organized by account. Ver is the client version reported, Sess is the connection session used. Port is confusingly labeled, and actually indicates the location the user is connected from. Where shows what state they are in, usually "Game" (IE, in the game), and which character is in the game.

Command: terminate [save|NoSave]
Parameters: "save" means do a save before ending, "NoSave" means terminate the server immediately.
Purpose: Shuts down the game server.
Available by Maintenance Port? Yes.
Sample output:
terminate save
Garbage collecting and saving game... done.
Terminating server. All connections, including yours, about to be lost
Comments: Shuts down the server completely.  Note that there is no way to restart the server via admin commands, since the server must be online to accept commands!  Also, the message show above does not appear until the game is done saving, which can take several minutes.

The Accounts File

What is it?

The accounts file is a file that lists all the accounts on the server, and can be parsed to compare against external records. This is one of the files saved to the hard drive when the server saves the game.

The file is found in "game\accounts.*" in the server installation. The extension of the file is the timestamp of when it was saved. The server writes a new file every save cycle, so you should look for the most recent file. Note that any change in the accounts since last server save will NOT be reflected in the file.

What is the format?

A file could look like this:
ACCOUNT 1:Chris.Kirmse:0:1:0:0:0
ACCOUNT 2:Andrew.Kirmse:0:1:0:0:0
ACCOUNT 3:green.b:0:1:1044852942:25081:0
ACCOUNT 4:ellis.r:0:1:1044645282:57235:0
ACCOUNT 5:ellis.c:0:1:1043870283:10124:1404953660
NEXT_ACCOUNT_ID 6

You'll notice each line is a separate account, with information separated by colons (:).

First column is the word "ACCOUNT", then the account number.
Second column is the account name.
Third column is the encrypted password. (Ignore the similarities shown above, this was taken from an internal server that uses default passwords.)
Fourth column is the account permission level. 0 for user, 1 for admin, 2 for DM.
Fifth column is last login timestamp.
Sixth column is the number of seconds spent online by this account.  This is the same as the "credits" amount indicated above.
Last column indicates the timestamp of when the account will be unsuspended. In most cases, this is 0 for users that not currently suspended. However, if an account has passed it's unsuspension time and the user has not logged on since then, this will still show a non-zero value. Since this is a timestamp, you could compare it to current time, assuming the times are synchronized (or fairly close).